@using MvcDemo.Models;
@model IEnumerable<Product>;
    @{
        Layout=null;
    }
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <link rel="stylesheet" href="~/css/base.css">
    <style>
        #father{
    width: 700px;
    height: 500px;
    margin: auto;
}
table tr{
    padding-left: 45px;
    padding-right: 45px;
}
table th{
    background-color: orange;
}
#ChaZhao:hover{
    transition: 0.5s;
    transform: scale(1.1);
    cursor: pointer;
}
#XinZeng:hover{
    transition: 0.5s;
    transform: scale(1.1);
    cursor: pointer;
}
    </style>
</head>
<body>
         <div id="father">
             <div id="top">
                 <input type="button" value="查找" id="ChaZhao">
                 <input type="text" placeholder="请输入关键字查找" name="KeyWork">
                 <input type="button" value="新增" id="XinZeng">
             </div>
             <table id="Tb">
                 <tr>
                     <th>Id</th>
                     <th>商品名称</th>
                     <th>供应商名称</th>
                     <th>价格</th>
                     <th>库存数量</th>
                     <th>备注</th>
                     <th>操作</th>
                 </tr>
               @foreach (var item in Model)
                {
                    <tr class="table">
                     <td>@item.Id</td>
                     <td>@item.ProductName</td>
                     <td>@item.Supplier</td>
                     <td>@item.Price</td>
                     <td>@item.Stock</td>
                     <td>@item.Remarks</td>
                     <td>
                         <input type="button" value="编辑" onclick="btnEdit(@item.Id)">
                         <input type="button" value="删除" onclick="btnDele(@item.Id)">
                     </td>
                 </tr>
                } 
             </table>
         </div>
</body>
<script src="~/js/jquery.min.js"></script>
<script src="~/js/base.js"></script>
</html>